<?php
class DigUi_View_Helper_DigUiSelectMacro extends Zend_View_Helper_Abstract
{
    public function digUiSelectMacro($name, $value = null, $attribs = array()) {
        $model = new DigUi_Model_Macro();
        $macros = $model->fetchAll();
        $selectOptions['false'] = 'Select a macro to run';
        if($macros) {
            foreach ($macros as $macro) {
                $selectOptions[$macro->jquery_script] = str_replace('_', ' ', $macro->name);
            }
            return $this->view->formSelect($name, $value, $attribs, $selectOptions);
        }
    }
}
?>
